<?php

namespace frontend\modules\cms\models;

/**
 * 资讯评论模型
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class ArticleCommentSearch extends \common\models\cms\CmsArticleComment {

    /**
     * 构建评论检索
     */
    public function buildQuery() {
        $query = $this->find()
        ->active(static::STATUS_ACTIVE)
        ->andWhere([
            'comment_id' => 0,
            'article_id' => $this->article_id
        ])
        ->with(['userCell', 'children'])
        ->orderBy(['created_at' => SORT_DESC]);
        return $query;
    }

}
